home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / dev / gcc / gcc270_src.lha / gcc-2.7.0-amiga / config / m68k / t-amigados < prev    next >
Text File  |  1995-08-24  |  15KB  |  353 lines

  1. # Makefile fragment for amigados target.
  2.  
  3. # We generate two additional things:
  4. #
  5. # libb/libgcc.a
  6. #    A base relative version of libgcc.a which is used when compiling and
  7. #    linking with the '-resident' option.
  8. #
  9. # libb/libm020/libgcc.a
  10. #    An accelerated base relative version of libgcc.a which is used when
  11. #    compiling and linking with the '-mc68020' & '-resident' options.
  12. #
  13. # libm020/libgcc.a
  14. #    An accelerated version of libgcc.a which is used when compiling and
  15. #    linking with the '-mc68020' option.
  16. #
  17. # xgccv
  18. #    A forking gcc instead of one calling ssytem(). This makes it less
  19. #    system conformant (can't ^C it when started from make), while providing
  20. #    increased functionality (-pipe option).
  21.  
  22. # Use the vfork'ing version of gcc by default, so that the -pipe option can
  23. # get tested.  To use the regular version just do "make XGCC=gcc".  Note that
  24. # PIPE is defined in x-amigados, so if we are doing a native build, it will
  25. # be defined.  It can be overridden with "make PIPE=".
  26.  
  27. XGCC = xgccv $(PIPE)
  28. GCC_FOR_TARGET = ./$(XGCC) -B./
  29.  
  30. # Build residentable versions of the gcc executables by default.  Use
  31. # "make RESIDENT=" to build non-residentable versions.
  32. # Note:  This failed during bootstrapping of 2.5.5.
  33.  
  34. #RESIDENT = -resident
  35.  
  36. # The standard additional target flags for the compiler.
  37.  
  38. T_CFLAGS = $(RESIDENT)
  39.  
  40. # Allow the user to override the default target optimizations with gcc, or if
  41. # the target compiler is not gcc and doesn't understand -O<N>.
  42.  
  43. T_OPTIMISE = -O2
  44.  
  45. # Each compilation environment (Manx, Dice, GCC, SAS/C, etc) provides its
  46. # own equivalent of the UNIX /usr/include tree.  For gcc, the standard headers
  47. # are in /gnu/include and system specific headers are in /gnu/os-include.
  48. # Use these paths for fixincludes.
  49.  
  50. SYSTEM_HEADER_DIR = /gnu/include
  51. OTHER_FIXINCLUDES_DIRS = /gnu/os-include
  52.  
  53. # We don't need a libgcc1, it's all in ixemul.library
  54.  
  55. LIBGCC1 = libgcc1.null
  56.  
  57. # Flags to use when compiling the normal version of libgcc.a.
  58. # Don't compile with debugging, as long as there is no debugger.
  59. # Explicitly leave out the -resident compilation flag and don't use T_CFLAGS.
  60.  
  61. LIBGCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  62.           $(CROSS_GCC_CFLAGS)
  63.  
  64. # Flags to use when compiling the base relative version of libgcc.a.
  65. # Don't compile with debugging, as long as there is no debugger.
  66. # Explicitly force -resident in the compilation flags and don't use T_CFLAGS.
  67.  
  68. LIBBGCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  69.           $(CROSS_GCC_CFLAGS) -resident
  70.  
  71. # Flags to use when compiling the 68020 versions of libgcc.a.
  72. # Don't compile with debugging, as long as there is no debugger.
  73. # Explicitly force -mc68020 in the compilation flags and don't use T_CFLAGS.
  74.  
  75. LIBM020GCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  76.           $(CROSS_GCC_CFLAGS) -mc68020
  77.  
  78. # Flags to use when compiling the base relative 68020 versions of libgcc.a.
  79. # Don't compile with debugging, as long as there is no debugger.
  80. # Explicitly force -mc68020 & -resident in the compilation flags and don't use
  81. # T_CFLAGS.
  82.  
  83. LIBBM020GCC2_CFLAGS = $(LIBBGCC2_CFLAGS) -mc68020
  84.  
  85. # Build the base relative library and accelerated libraries.
  86. # It is later copied into /gnu/lib/gcc-lib/amigados/<version>/libb/libgcc.a, whereas
  87. # libgcc.a is copied into /gnu/lib/gcc-lib/amigados/<version>/libgcc.a.
  88. # Accelerated libraries are copied into same directories, with an extra dir level
  89. # libm020, thus libb/libm020. It doesn't work very well to define one of the
  90. # EXTRA_* macros to contain libb/libgcc.a, particularly for doing "make stageN"
  91. # or "make install".
  92.  
  93. GCC_PARTS=$(GCC_PASSES) libgcc.a libb/libgcc.a libm020/libgcc.a \
  94.         libb/libm020/libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
  95.  
  96. # Add install_libbgcc to normal define of INSTALL_LIBGCC.  Let install-gccv
  97. # hitch a ride on here as well.
  98.  
  99. INSTALL_LIBGCC = install-libgcc install-libbgcc install-libm020gcc install-libbm020gcc install-gccv
  100.  
  101. # This includes the knowledge that target amigados doesn't need libgcc1.a
  102.  
  103. libb/libgcc.a: libgcc1.null libgcc2.c libgcc2.ready $(CONFIG_H) \
  104.    $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
  105. # Actually build it in tmplibbgcc.a, then rename at end,
  106. # so that libb/libgcc.a itself remains nonexistent if compilation is aborted.
  107.     -rm -f tmplibbgcc.a
  108. # -e causes any failing command to make this rule fail.
  109. # -e doesn't work in certain shells, so we test $$? as well.
  110.     set -e; \
  111.     for name in $(LIB2FUNCS); \
  112.     do \
  113.       echo $${name}; \
  114.       $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  115.           $(srcdir)/libgcc2.c -o $${name}.o; \
  116.       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  117.       $(AR) $(AR_FLAGS) tmplibbgcc.a $${name}.o; \
  118.       rm -f $${name}.o; \
  119.     done
  120. # Some shells crash when a loop has no items.
  121. # So make sure there is always at least one--`..'.
  122. # Then ignore it.
  123. # We don't use -e here because there are if statements
  124. # that should not make the command give up when the if condition is false.
  125. # Instead, we test for failure after each command where it matters.
  126.     -for file in .. $(LIB2FUNCS_EXTRA); \
  127.     do \
  128.       if [ x$${file} != x.. ]; then \
  129.         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  130.         echo $${name}; \
  131.         if [ $${name}.asm = $${file} ]; then \
  132.           cp $${file} $${name}.s || exit 1; file=$${name}.s; \
  133.         else true; fi; \
  134.         $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
  135.         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  136.         $(AR) $(AR_FLAGS) tmplibbgcc.a $${name}.o; \
  137.         rm -f $${name}.[so]; \
  138.       else true; \
  139.       fi; \
  140.     done
  141.     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibbgcc.a; else true; fi
  142.     -if [ -d libb ] ; then true ; else mkdir libb ; fi
  143.     mv tmplibbgcc.a libb/libgcc.a
  144.  
  145.  
  146. install-libbgcc: libb/libgcc.a install-dir
  147.     -if [ -d $(libsubdir)/libb ] ; then true ; else mkdir $(libsubdir)/libb ; fi
  148.     -if [ -f libb/libgcc.a ] ; then \
  149.       rm -f $(libsubdir)/libb/libgcc.a; \
  150.       $(INSTALL_DATA) libb/libgcc.a $(libsubdir)/libb/libgcc.a; \
  151.       if $(RANLIB_TEST) ; then \
  152.         (cd $(libsubdir)/libb; $(RANLIB) libgcc.a); else true; fi; \
  153.       chmod a-x $(libsubdir)/libb/libgcc.a; \
  154.     else true; fi
  155.  
  156. libm020/libgcc.a: libgcc1.null libgcc2.c libgcc2.ready $(CONFIG_H) \
  157.    $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
  158. # Actually build it in tmplibm020gcc.a, then rename at end,
  159. # so that libm020/libgcc.a itself remains nonexistent if compilation is aborted.
  160.     -rm -f tmplibm020gcc.a
  161. # -e causes any failing command to make this rule fail.
  162. # -e doesn't work in certain shells, so we test $$? as well.
  163.     set -e; \
  164.     for name in $(LIB2FUNCS); \
  165.     do \
  166.       echo $${name}; \
  167.       $(GCC_FOR_TARGET) $(LIBM020GCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  168.           $(srcdir)/libgcc2.c -o $${name}.o; \
  169.       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  170.       $(AR) $(AR_FLAGS) tmplibm020gcc.a $${name}.o; \
  171.       rm -f $${name}.o; \
  172.     done
  173. # Some shells crash when a loop has no items.
  174. # So make sure there is always at least one--`..'.
  175. # Then ignore it.
  176. # We don't use -e here because there are if statements
  177. # that should not make the command give up when the if condition is false.
  178. # Instead, we test for failure after each command where it matters.
  179.     -for file in .. $(LIB2FUNCS_EXTRA); \
  180.     do \
  181.       if [ x$${file} != x.. ]; then \
  182.         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  183.         echo $${name}; \
  184.         if [ $${name}.asm = $${file} ]; then \
  185.           cp $${file} $${name}.s || exit 1; file=$${name}.s; \
  186.         else true; fi; \
  187.         $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
  188.         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  189.         $(AR) $(AR_FLAGS) tmplibm020gcc.a $${name}.o; \
  190.         rm -f $${name}.[so]; \
  191.       else true; \
  192.       fi; \
  193.     done
  194.     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibm020gcc.a; else true; fi
  195.     -if [ -d libm020 ] ; then true ; else mkdir libm020 ; fi
  196.     mv tmplibm020gcc.a libm020/libgcc.a
  197.  
  198.  
  199. install-libm020gcc: libm020/libgcc.a install-dir
  200.     -if [ -d $(libsubdir)/libm020 ] ; then true ; else mkdir $(libsubdir)/libm020 ; fi
  201.     -if [ -f libm020/libgcc.a ] ; then \
  202.       rm -f $(libsubdir)/libm020/libgcc.a; \
  203.       $(INSTALL_DATA) libm020/libgcc.a $(libsubdir)/libm020/libgcc.a; \
  204.       if $(RANLIB_TEST) ; then \
  205.         (cd $(libsubdir)/libm020; $(RANLIB) libgcc.a); else true; fi; \
  206.       chmod a-x $(libsubdir)/libm020/libgcc.a; \
  207.     else true; fi
  208.  
  209. libb/libm020/libgcc.a: libgcc1.null libgcc2.c libgcc2.ready $(CONFIG_H) \
  210.    $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
  211. # Actually build it in tmplibbm020gcc.a, then rename at end,
  212. # so that libb/libm020/libgcc.a itself remains nonexistent if compilation is aborted.
  213.     -rm -f tmplibbm020gcc.a
  214. # -e causes any failing command to make this rule fail.
  215. # -e doesn't work in certain shells, so we test $$? as well.
  216.     set -e; \
  217.     for name in $(LIB2FUNCS); \
  218.     do \
  219.       echo $${name}; \
  220.       $(GCC_FOR_TARGET) $(LIBBM020GCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  221.           $(srcdir)/libgcc2.c -o $${name}.o; \
  222.       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  223.       $(AR) $(AR_FLAGS) tmplibbm020gcc.a $${name}.o; \
  224.       rm -f $${name}.o; \
  225.     done
  226. # Some shells crash when a loop has no items.
  227. # So make sure there is always at least one--`..'.
  228. # Then ignore it.
  229. # We don't use -e here because there are if statements
  230. # that should not make the command give up when the if condition is false.
  231. # Instead, we test for failure after each command where it matters.
  232.     -for file in .. $(LIB2FUNCS_EXTRA); \
  233.     do \
  234.       if [ x$${file} != x.. ]; then \
  235.         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  236.         echo $${name}; \
  237.         if [ $${name}.asm = $${file} ]; then \
  238.           cp $${file} $${name}.s || exit 1; file=$${name}.s; \
  239.         else true; fi; \
  240.         $(GCC_FOR_TARGET) $(LIBBGCC2CFLAGS) $(INCLUDES) -c $${file}; \
  241.         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  242.         $(AR) $(AR_FLAGS) tmplibbm020gcc.a $${name}.o; \
  243.         rm -f $${name}.[so]; \
  244.       else true; \
  245.       fi; \
  246.     done
  247.     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibbm020gcc.a; else true; fi
  248.     -if [ -d libb ] ; then true ; else mkdir libb ; fi
  249.     -if [ -d libb/libm020 ] ; then true ; else mkdir libb/libm020 ; fi
  250.     mv tmplibbm020gcc.a libb/libm020/libgcc.a
  251.  
  252.  
  253. install-libbm020gcc: libb/libm020/libgcc.a install-dir
  254.     -if [ -d $(libsubdir)/libb/libm020 ] ; then true ; else mkdir $(libsubdir)/libb/libm020 ; fi
  255.     -if [ -f libb/libm020/libgcc.a ] ; then \
  256.       rm -f $(libsubdir)/libb/libm020/libgcc.a; \
  257.       $(INSTALL_DATA) libb/libm020/libgcc.a $(libsubdir)/libb/libm020/libgcc.a; \
  258.       if $(RANLIB_TEST) ; then \
  259.         (cd $(libsubdir)/libb/libm020; $(RANLIB) libgcc.a); else true; fi; \
  260.       chmod a-x $(libsubdir)/libb/libm020/libgcc.a; \
  261.     else true; fi
  262.  
  263. # PhB:
  264. # toplev.o target need to define additional flags to handle stack
  265. # allocation in real main. As for now we hack building of toplev.o
  266. # defining MAYBE_USE_COLLECT2 flag, which is only used for toplev.o.
  267. # Then we define EXTRA_OBJS to amigasup.o.
  268.  
  269. MAYBE_USE_COLLECT2= -Dmain=stkmain -Dexit=stkexit
  270. EXTRA_OBJS = amigasup.o
  271.  
  272. # The default gcc (xgcc) is built without -DAMIGADOS_FORK_GCC. This gcc (xgccv)
  273. # is built with AMIGADOS_FORK_GCC defined, so that it can use '-pipe'.  We
  274. # don't want to define EXTRA_PASSES to xgccv because that will cause xgccv
  275. # to be installed in $(libsubdir), so instead we use the default GCC_PASSES
  276. # and add xgccv to it.
  277.  
  278. GCC_PASSES = xgcc xgccv cc1 cpp $(EXTRA_PASSES)
  279.  
  280. xgccv: xgccv.o version.o $(LIBDEPS)
  281.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgccv xgccv.o version.o $(LIBS)
  282.  
  283. xgccv.o: gcc.c $(CONFIG_H) config.status
  284.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  285.   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  286.   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  287.   -DDEFAULT_TARGET_VERSION=\"$(version)\" \
  288.   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  289.   -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \
  290.   -DAMIGADOS_FORK_GCC \
  291.   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` -o xgccv.o
  292.  
  293. install-gccv: xgccv
  294.     rm -f $(bindir)/gccv
  295.     $(INSTALL_PROGRAM) xgccv $(bindir)/gccv
  296.  
  297. # When making one of the stage<N> dirs, we need to make subdirs for
  298. # additional libraries, and copy them there. base-relative libraries
  299. # and accelerated libraries are preserved through stages.
  300.  
  301. EXTRA_STAGE1_TARGETS = stage1-libamiga
  302. EXTRA_STAGE2_TARGETS = stage2-libamiga
  303. EXTRA_STAGE3_TARGETS = stage3-libamiga
  304. EXTRA_STAGE4_TARGETW = stage4-libamiga
  305.  
  306. stage1-libamiga:
  307.     -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
  308.     -if [ -d stage1/libb ] ; then true ; else mkdir stage1/libb ; fi
  309.     -if [ -d stage1/libb/libm020 ] ; then true ; else mkdir stage1/libb/libm020 ; fi
  310.     -if [ -d stage1/libm020 ] ; then true ; else mkdir stage1/libm020 ; fi
  311.     -cp libb/libgcc.a stage1/libb/libgcc.a
  312.     -cp libb/libm020/libgcc.a stage1/libb/libm020/libgcc.a
  313.     -cp libm020/libgcc.a stage1/libm020/libgcc.a
  314.     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libb/libgcc.i; else true; fi
  315.     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libb/libm020/libgcc.a; else true; fi
  316.     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libm020/libgcc.a; else true; fi
  317.  
  318. stage2-libamiga:
  319.     -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
  320.     -if [ -d stage2/libb ] ; then true ; else mkdir stage2/libb ; fi
  321.     -if [ -d stage2/libb/libm020 ] ; then true ; else mkdir stage2/libb/libm020 ; fi
  322.     -if [ -d stage2/libm020 ] ; then true ; else mkdir stage2/libm020 ; fi
  323.     -cp libb/libgcc.a stage2/libb/libgcc.a
  324.     -cp libb/libm020/libgcc.a stage2/libb/libm020/libgcc.a
  325.     -cp libm020/libgcc.a stage2/libm020/libgcc.a
  326.     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libb/libgcc.a; else true; fi
  327.     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libb/libm020/libgcc.a; else true; fi
  328.     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libm020/libgcc.a; else true; fi
  329.  
  330. stage3-libamiga:
  331.     -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
  332.     -if [ -d stage3/libb ] ; then true ; else mkdir stage3/libb ; fi
  333.     -if [ -d stage3/libb/libm020 ] ; then true ; else mkdir stage3/libb/libm020 ; fi
  334.     -if [ -d stage3/libm020 ] ; then true ; else mkdir stage3/libm020 ; fi
  335.     -cp libb/libgcc.a stage3/libb/libgcc.a
  336.     -cp libb/libm020/libgcc.a stage3/libb/libm020/libgcc.a
  337.     -cp libm020/libgcc.a stage3/libm020/libgcc.a
  338.     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libb/libgcc.a; else true; fi
  339.     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libb/libm020/libgcc.a; else true; fi
  340.     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libm020/libgcc.a; else true; fi
  341.  
  342. stage4-libamiga:
  343.     -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
  344.     -if [ -d stage4/libb ] ; then true ; else mkdir stage4/libb ; fi
  345.     -if [ -d stage4/libb/libm020 ] ; then true ; else mkdir stage4/libb/libm020 ; fi
  346.     -if [ -d stage4/libm020 ] ; then true ; else mkdir stage4/libm020 ; fi
  347.     -cp libb/libgcc.a stage4/libb/libgcc.a
  348.     -cp libb/libm020/libgcc.a stage4/libb/libm020/libgcc.a
  349.     -cp libm020/libgcc.a stage4/libm020/libgcc.a
  350.     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libb/libgcc.a; else true; fi
  351.     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libb/libm020/libgcc.a; else true; fi
  352.     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libm020/libgcc.a; else true; fi
  353.